Skip to content

refactor: Phase 1 consolidation — fewer files, less duplication#6

Merged
robbycochran merged 4 commits into
mainfrom
rc-dir
Jun 4, 2026
Merged

refactor: Phase 1 consolidation — fewer files, less duplication#6
robbycochran merged 4 commits into
mainfrom
rc-dir

Conversation

@robbycochran

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of the improvement plan: consolidate before adding features.

  • Delete dead filessandbox.yaml, teardown-ocp.sh, delete-sandboxes.sh, sandbox-check.sh, sandbox.sh (5 files, 362 lines)
  • Extract lib/agent.sh — shared TOML parsing (parse_agent), provider flag building (build_provider_flags), credential staging (stage_harness_dir), ANSI stripping (strip_ansi). Used by sandbox-podman.sh, sandbox-ocp.sh, test-flow.sh.
  • Simplify startup.sh — remove dead .claude.json write (Claude Code overwrites it on startup)
  • Clean up lib/common.sh — remove 7 stale functions superseded by lib/agent.sh: active_gateway, require_ocp_gateway, detect_providers, PROVIDER_NAMES, write_sandbox_env, stage_sandbox_creds, available_providers (145 lines)

Test results

bats:   29/29
podman: 13/13 (23s)
ocp:    14/14 (202s)

Test plan

  • bats test/preflight.bats — 29/29
  • ./test-flow.sh podman --full — 13/13
  • ./test-flow.sh ocp --full — 14/14

🤖 Generated with Claude Code

robbycochran and others added 4 commits June 3, 2026 22:12
Remove sandbox.yaml, teardown-ocp.sh, delete-sandboxes.sh,
sandbox-check.sh, sandbox.sh. Update references in remaining files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- parse_agent: TOML parsing shared by sandbox-podman.sh, sandbox-ocp.sh
- build_provider_flags: provider iteration shared by both sandbox scripts
- stage_harness_dir: GWS + sandbox.env staging shared by both flows
- strip_ansi: replaces inline sed in test-flow.sh
- Fix AGENT_FILE unbound variable in sandbox-ocp.sh

Tested: bats 29/29, podman 13/13 (25s), ocp 14/14 (132s)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
startup.sh: remove dead .claude.json write (Claude Code overwrites it).
Keep only sandbox.env sourcing and gh auth setup-git.

lib/common.sh: remove stale functions superseded by lib/agent.sh:
  active_gateway, require_ocp_gateway, detect_providers, PROVIDER_NAMES,
  write_sandbox_env, stage_sandbox_creds, available_providers.
Simplify require_local_gateway to check 127.0.0.1 directly.

Tested: bats 29/29, podman 13/13 (23s), ocp 14/14 (202s)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant